<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>50元话费免费得</title>
        <meta name="viewport" content="initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="__PUBLIC__/h5/acti/css/active.css">
		<link href="__PUBLIC__/h5/acti/css/sm.min.css" rel="stylesheet">

		<script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
		<script src="__PUBLIC__/admin/plugins/layer/layer.js?v=2.4"></script>
		<script src="__PUBLIC__/admin/js/jquery.form.js"></script>
		<script src="__PUBLIC__/admin/js/common.js"></script>
		
		<style>
			.content{background: url(__PUBLIC__/h5/acti/img/bj1.jpg) no-repeat 0 0;background-size:100% 100%;}
			.list-block{margin: .75rem 0;}
			.list-block ul{background: #eaf4f7;}
			.row>[class*=col-], .row>[class*=tablet-]{float:none;}
			#mcoverfg {position:fixed;top:0;left: 0;width:100%;height:100%;background: rgba(0, 0, 0, 0.7);display:block;z-index: 20000;}
			#mcoverfg2 {position:fixed;top:0;left: 0;width:100%;height:100%;background: rgba(0, 0, 0, 0.7);display:block;z-index: 20000;}
			#mcoverfg4 {position:fixed;top:0;left: 0;width:100%;height:100%;background: rgba(0, 0, 0, 0.7);display:block;z-index: 20000;}
		</style>

    </head>
    <body>
        <div class="page-group">
            <div class="page page-current">
                <div class="content">
					<div class="content-block">
						<div class="content10"><img src="__PUBLIC__/h5/acti/img/jiemian1.png"></div>
						<div class="content20">
							<div class="content_img"><img src="{$item['img']}"></div>
							<div class="content_title">{$item['nickname']}</div>
						</div>
						<div class="content30"><img src="__PUBLIC__/h5/acti/img/wenben5.png"></div>
						<div class="content40"><img src="__PUBLIC__/h5/acti/img/anniu1.png"></div>
						<div class="content50">
							<form action="{:U('Acti/getboost')}" method="post">
								<input type="hidden" name="img" value="{$item.img}">
								<input type="hidden" name="nickname" value="{$item.nickname}">
								<input type="hidden" name="id" value="{$item.id}">
								<input type="hidden" name="area" value="{$item.area}">
								<div class="list-block">
									<ul>
									  <!-- Text inputs -->
										<li>
											<div class="item-content">
											  <div class="item-media"><i class="icon icon-form-name"></i></div>
											  <div class="item-inner">
												<div class="item-title label">手机号码：</div>
												<div class="item-input">
												  <input type="text" name="phone" placeholder="填写手机号码" id="phone_num" value="">
												</div>
											  </div>
											</div>
										</li>
										<li>
											<div class="item-content">
											  <div class="item-media"><i class="icon icon-form-email"></i></div>
											  <div class="item-inner">
												<div class="item-title label">验证码：</div>
												<div class="item-input">
												  <input type="text" name="code" placeholder="填写验证码" id="code_num" value="">
												</div>
												<div id="dings" class="button-fill col-15 buttonSmall " style="width: 5.1rem;margin-left: -7.9rem;background-color: rgb(246, 84, 28);border-radius: .3rem;text-align: center;padding-top: .2rem;padding-bottom: .15rem;font-size: .72rem;color:#ffffff;">获取验证码</div>
											  </div>
											</div>
										</li>
										<div class="content-block" style="margin-top:.5rem;padding-bottom:.8rem;">
											<div class="row">
												<div class="col-100" style="margin: 0 auto;">
													<button type="submit" class="col-50 form-submit-btn button button-big button-fill button-success" id="submit" style="margin-left:30%;line-height: 2rem;height:2rem;">验证</button>
												</div>
											</div>
										</div>
									</ul>
								 </div>
								 
								
							</form>
						</div>
					</div>
				</div>
				
				<!--报错提示框-->
				<div id="mcoverfg" style="display:none;">
					<div class="mcoverfg1">
						<div class="mcoverfg_top" id="mcoverfg_topdf1"><p>您已经为其他好友开过话费了不能再为当前好友开话费了</p></div>
					</div>
					<div class="mcoverfg_bott"><a href="#" id="xiazai1"><img src="__PUBLIC__/h5/acti/img/anniu30.png"></a></div>
				</div>
				
				<!--获取话费-->
				<div id="mcoverfg2" style="display:none;">
					<div class="mcoverfg3">
						<div class="mcoverfg_top" id="mcoverfg_topdf2"><p>恭喜成功为好友增加开话费1次</p></div>
					</div>
					<div class="mcoverfg_bott3"><a href="#" id="mcoverfg_topdf4"><img src="__PUBLIC__/h5/acti/img/anniu30.png"></a></div>
				</div>
				
				<!--奖励展示-->
				<div id="mcoverfg4" style="display:none;">
					<div class="mcoverfg4">
						<div class="mcoverfg_top5"  id="mcoverfg_topdf3"><a href="#" id="xiazai2"><img src="__PUBLIC__/h5/acti/img/jiemian7.png"></a></div>
					</div>
				</div>
				
            </div>
        </div>

    </body>
</html>

<script type="text/javascript">
    function time(wait , o){
				if (wait == 0) {
					wait = 120
					o.text("重新获取")
					o.on('click', function () {
						time(wait, $(this));
						$(this).off('click');
					});
				} else {
					o.text("等待" + wait + '秒')
					wait--;
					setTimeout(function () {
						time(wait, o);
					}, 1000)
				}

    }
<!--获取验证码走ajax开始-->
    $("#dings").click(function (){
        var id = $("input[name='id']").val();
        var area = $("input[name='area']").val();
        var phone = $("input[name='phone']").val();
	    	var reg = /(1[3-9]\d{9}$)/;
	    	var $that=$(this)
        if ($("#phone_num").val() == ''){
            layer.msg("请填写手机号码");
            return false;
        }else if(phone.length !=11){
		       	layer.msg("请输入有效的手机号码");
            return false;
	    	}else if(!reg.test(phone)){
		      	layer.msg("请输入有效的手机号码");
            return false;
		    }else{
					$.ajax({
						type:'POST',
						url:"{:U('Acti/getcode')}",
						dataType:'json',
						data:{id:id,area:area,phone:phone},
						success:function(data){
							//请求成功函数内容
							if (data.status == 1) {
								layer.msg(data.msg,{time: 2000});
								time(120, $that)
								$that.off('click')
							} else {
								layer.msg(data.msg,{time: 2000});
							}
						},
						error:function(jqXHR){
							//请求失败函数内容
						}
					});
				}

    });
<!--获取验证码走ajax结束-->
<!--获奖数据处理开始-->
    $(function () {
        $("#submit").click(function (){
            if($("input[name='id']").val() ==''){
                layer.msg("分享者ID不能为空");
                return false;
			}
			
			var phone = $("input[name='phone']").val();
			var reg = /(1[3-9]\d{9}$)/;
			if ($("#phone_num").val() == ''){
				layer.msg("请填写手机号码");
				return false;
			}else if(phone.length !=11){
				layer.msg("请输入有效的手机号码");
				return false;
			}else if(!reg.test(phone)){
				layer.msg("请输入有效的手机号码");
				return false;
			}
			
            /*if($("#phone_num").val() == ''){
                layer.msg("手机号码不能为空");
                return false;
            }*/
            if($("#code_num").val() == ''){
                layer.msg("验证码不能为空");
                return false;
            }

			$('form').ajaxSubmit({
				url: "{:U('Acti/getboost')}",
				type: "POST",
				success: function (res) {
					if(res.status == 1){
						//layer.msg(res.msg, {time: 3000});
						$("#mcoverfg").hide();
						//$("#mcoverfg2").show();
						$("#mcoverfg4").show();
						//$("#mcoverfg_topdf2").empty();
						//$("#mcoverfg_topdf2").append("<p>"+res.msg+"</p>");
					}else{
						if(res.reload == 1){
							layer.msg(res.msg,{time: 2000});
						}else{
							$("#mcoverfg").show();
							$("#mcoverfg2").hide();
							$("#mcoverfg4").hide();
							$("#mcoverfg_topdf1").empty();
							$("#mcoverfg_topdf1").append("<p>"+res.msg+"</p>");
						}	
					}
				},
			});
			return false;
        });
		$("#mcoverfg_topdf4").click(function (){
			$("#mcoverfg").hide();
			$("#mcoverfg2").hide();
			//$("#mcoverfg4").show();
		});
    });
	

<!--获奖数据处理结束-->

<!--拉起游戏下载页面开始-->

//判断访问终端
	var browser={
		versions:function(){
			var u = navigator.userAgent, app = navigator.appVersion;
			return {
				trident: u.indexOf('Trident') > -1, //IE内核
				presto: u.indexOf('Presto') > -1, //opera内核
				webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
				gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,//火狐内核
				mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
				ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
				android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
				iPhone: u.indexOf('iPhone') > -1 , //是否为iPhone或者QQHD浏览器
				iPad: u.indexOf('iPad') > -1, //是否iPad
				webApp: u.indexOf('Safari') == -1, //是否web应该程序，没有头部与底部
				weixin: u.indexOf('MicroMessenger') > -1, //是否微信 （2015-01-22新增）
				qq: u.match(/\sQQ/i) == " qq" //是否QQ
			};
		}(),
		language:(navigator.browserLanguage || navigator.language).toLowerCase()
	}
	
	//安卓APP唤起连接地址
	function openAndroid(){
		window.location.href ="jormi://JM7bb28f75b27e4710/openwith";
	}
	
	//苹果APP唤起连接地址
	function openIOS(){
		window.location.href ="JM7bb28f75b27e4710://jormi/";
	}
	
	//触发点击事件判断
	$("#xiazai1").click(function (){
		$("#mcoverfg").hide();
		$("#mcoverfg2").hide();
		$("#mcoverfg4").hide();
	});
	
	$("#mcoverfg_topdf4").click(function (){
		$("#mcoverfg").hide();
		$("#mcoverfg2").hide();
		$("#mcoverfg4").hide();
	});
	
	//触发点击事件判断
	/*$("#xiazai1").click(function (){
		if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){
			openIOS();
			var url="http://zadia.gzyxo6.cn/dhem/asdf/";
			setTimeout("location.href='"+url+"'",1000);
        //苹果端
		}else if(/(Android)/i.test(navigator.userAgent)){
			openAndroid();
			//安卓端
			var url="http://zadia.gzyxo6.cn/dhem/asdf/";
			setTimeout("location.href='"+url+"'",1000);
		}else{
			openAndroid();
			//安卓端
			var url="http://zadia.gzyxo6.cn/dhem/asdf/";
			setTimeout("location.href='"+url+"'",1000);
		};
	});*/
	
	$("#xiazai2").click(function (){
		if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){
			//window.location.href ="JM7bb28f75b27e4710://jormi/";
			openIOS();
			var url="http://zadia.gzyxo6.cn/dhem/asdf/";
			setTimeout("location.href='"+url+"'",3000);
        //苹果端
		}else if(/(Android)/i.test(navigator.userAgent)){
			//window.location.href ="jormi://JM7bb28f75b27e4710/openwith";
			openAndroid();
			//安卓端
			var url="http://zadia.gzyxo6.cn/dhem/asdf/";
			setTimeout("location.href='"+url+"'",3000);
		}else{
			openAndroid();
			//安卓端
			var url="http://zadia.gzyxo6.cn/dhem/asdf/";
			setTimeout("location.href='"+url+"'",3000);
		};
	});
	
</script>
<!--拉起游戏下载页面结束-->
